FROM node:20.18.1-alpine3.21 AS gobuilder
USER root
WORKDIR /opt
COPY . /opt/

RUN  npm install&&npm run build

FROM cooting/nginx:base AS runtime
COPY --from=gobuilder /opt/dist /web/dist


# 打包命令 docker build  -t  cooting/web-admin:1.0 -f deploy/Dockerfile .
# 打包命令  docker-slim build  --dockerfile deploy/Dockerfile --continue-after=all  --tag cooting/arlog.slim:0.0.4 .
# 运行命令 docker rm -f arlog
# 运行命令 docker restart   arlog
# 运行命令 docker run -d --name arlog  -p 8080:80 cooting/arlog.slim:1.0